using Services;
using UnityEngine;

public class DialogSignalReceiver : MonoBehaviour
{
    private GameManager gameManager;
    private DialogSystem dialogSystem;
    [SerializeField]
    private DialogGraph[] dialogGraphs;

    private void Awake()
    {
        gameManager = ServiceLocator.Get<GameManager>();
        dialogSystem = GeneralTool.FindComponent<DialogSystem>("DialogUI");
    }

    public void StartDialog(int index)
    {
        if (dialogGraphs[index] != null)
        {
            dialogSystem.dialogGraph = dialogGraphs[index];
            gameManager.GameState = EGameState.DialogInPerformance;
        }
    }
}
